import About2 from "../pages/About2";
import Home from "../pages/Home";
import Messages from "../pages/Messages";
import News from "../pages/News";
import Detail from "../pages/Detail";
import {Navigate} from "react-router-dom";
import React from "react";

const routes = [
    {
        path: '/About',
        element: <About2/>
    },
    {
        path: '/Home',
        element: <Home/>,
        children: [
            {
                path: 'Message',
                element: <Messages/>,
                children: [
                    {
                        // path: 'Detail/:id/:title/:content',  // params
                        path: 'Detail',                         //Search & State
                        element: <Detail/>
                    }
                ]
            },
            {
                path: 'News',
                element: <News/>
            }
        ]
    },
    {
        path: '/',
        element: <Navigate to='/About'/>
    }
]

export default routes